package com.hjl.sr.remoting.adaptor;

import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpMethod;

import com.hjl.sr.remoting.HttpClientBase;

public class CommonHttpClientMethod implements HttpClientBase {
	
	private HttpMethod httpMethod;

	public CommonHttpClientMethod(HttpMethod httpMethod) {
		super();
		this.httpMethod = httpMethod;
	}

	public void addRequestHeader(String name, String value) {
		httpMethod.addRequestHeader(name, value);
	}

	public String getRequestHeader(String name) {
		Header header = httpMethod.getRequestHeader(name);
		if (header == null) {
			return null;
		}
		return header.getValue();
	}

}
